import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-07-15
 * Time: 18:45
 */
public class test3 {
    public static void main(String[] args) {
        int a=0;
        Scanner scanner = new Scanner(System.in);
        StringBuilder str1 = new StringBuilder(scanner.next());
        StringBuilder str2 = new StringBuilder(scanner.next());
        StringBuilder str3 = new StringBuilder();
        for (int i = 0; i < str1.length(); i++) {
            str3= str1.insert(i, str2);
            StringBuilder str4 = new StringBuilder();
            str4=str3.reverse();
            if(str3.equals(str4)){
                a++;
            }
        }
        System.out.println(a);
    }
}
